package com.wedo.mall;

import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;

import com.wedo.mall.activity.login.WLogin;

/**
 * Created by e on 2017/7/2.
 */

public class WService extends IntentService {

    private static final String ACTION_LOGIN = "login";

    public static void login(Context context) {
        Intent intent = new Intent(context, WService.class);
        intent.setAction(ACTION_LOGIN);
        context.startService(intent);
    }

    public WService() {
        this("WService");
    }

    public WService(String name) {
        super(name);
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        String action = intent.getAction();
        switch (action) {
            case ACTION_LOGIN:
                WLogin.with().auto(this);
                break;
        }
    }

}
